<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>口丁良教育培训管理系统</title>
    <link rel="stylesheet" href="/static/style/css/style.css">
    <%@ include file="/static/js/common/commons.jsp" %>

    <script>

        $(function () {

            $("#submitBtn").on("click",function () {


                $("#loginForm").form("submit",{

                    url:"/login.do",
                    success:function (data) {
                        //将原生的json格式转化
                        data = $.parseJSON(data);
                        if (data.success){

                            window.location.href = "/main.do";
                        }else {

                            $.messager.alert("温馨提示",data.msg,"info");
                        }
                    }
                })
            })
        })

    </script>

</head>
<body>
<section class="container">
    <div class="login">
        <h1>用户登录</h1>
        <form id="loginForm" method="post">
            <p><input type="text" name="username" value="" placeholder="账号"></p>
            <p><input type="password" name="password" value="" placeholder="密码"></p>
            <p class="submit">
                <input type="button" id="submitBtn" value="登录">
                <input type="button" value="重置">
            </p>
        </form>
    </div>
</section>
<div style="text-align:center;" class="login-help">
    <p>Copyright ©2018 北京口丁良教育科技有限公司</p>
</div>
</body>
</html>